Release 10.1A: OpenEdge Development:
Progress 4GL Reference
GET-BYTE function
Returns the unsigned 1 byte value at the specified memory location as an INTEGER.
Syntax
sourceA function or variable that returns a RAW or MEMPTR value. If
sourceis the Unknown value (?), GET-BYTE returns the Unknown value (?).positionAn integer value greater than 0 that indicates the byte position where you want to find the information. If
Examplespositionis greater than the length ofsource, Progress returns the Unknown value (?). Ifpositionis less than 1, Progress generates a run-time error.In this example, the RAW function goes to the customer field in the non-OpenEdge database. The GET-BYTE function accesses the first byte and stores the integer value of that byte in the variable i. The procedure then tests the value, if the integer value is 83 (the character code value for S), Progress displays the name.
The next procedure sets up a MEMPTR region with a character string and uses the GET-BYTE function to display the character code value of each character in the string.
Notes
- For more information on using the MEMPTR data type, see OpenEdge Development: Programming Interfaces .
- For more information on using the RAW data type, see OpenEdge Development: Programming Interfaces .
- You can use the alternative keyword GETBYTE instead of GET-BYTE.
See also
LENGTH function, PUT-BYTE statement, RAW function, RAW statement, SET-SIZE statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |